//package com.ebai.product.management.framework.common.exception;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
//import org.apache.shiro.authz.AuthorizationException;
//import org.apache.shiro.authz.UnauthorizedException;
//import org.springframework.web.servlet.HandlerExceptionResolver;
//import org.springframework.web.servlet.ModelAndView;
//import org.springframework.web.servlet.NoHandlerFoundException;
//
///**
// * 全局异常处理类
// * @author mgli
// *
// */
//public class ShiroExceptionHandler implements HandlerExceptionResolver{
//
//	@Override
//	public ModelAndView resolveException(HttpServletRequest request, HttpServletResponse response, Object handler,
//			Exception ex) {
//		// TODO Auto-generated method stub
//		System.out.println("进入shiro异常处理中心=========================");
//		ModelAndView mv;
//        //进行异常判断。如果捕获异常请求跳转。
//        if (ex instanceof UnauthorizedException || ex instanceof AuthorizationException) {
//            mv = new ModelAndView("error/unauth");
//        }
//        else if (ex instanceof NoHandlerFoundException) {
//        	mv = new ModelAndView("error/404");
//        } 
//        else {
//        	ex.printStackTrace();
//            mv = new ModelAndView("error/500");
//        }
//        return mv;
//	}
//}
